using System.ComponentModel.DataAnnotations;
using Lzfy_Refund_Service.Models;

namespace Lzfy_Refund_Service.Services
{
    /// <summary>
    /// 企业微信服务接口
    /// </summary>
    public interface IWeChatService
    {
        /// <summary>
        /// 获取企业微信Access Token
        /// </summary>
        /// <returns>Access Token</returns>
        Task<string> GetAccessTokenAsync();

        /// <summary>
        /// 根据授权码获取用户信息
        /// </summary>
        /// <param name="code">授权码</param>
        /// <returns>用户信息</returns>
        Task<WeChatUserInfo> GetUserInfoByCodeAsync(string code);

        /// <summary>
        /// 生成JS-SDK配置
        /// </summary>
        /// <param name="url">当前页面URL</param>
        /// <returns>JS-SDK配置</returns>
        Task<WeChatJsApiConfig> GetJsApiConfigAsync(string url);

        /// <summary>
        /// 验证企业微信签名
        /// </summary>
        /// <param name="signature">签名</param>
        /// <param name="timestamp">时间戳</param>
        /// <param name="nonce">随机字符串</param>
        /// <param name="echostr">随机字符串</param>
        /// <returns>验证结果</returns>
        bool VerifySignature(string signature, string timestamp, string nonce, string echostr);
    }
}